package com.chenfan.mcn.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chenfan.mcn.model.DepartmentTarget;
import com.chenfan.mcn.model.McnPage;
import com.chenfan.mcn.model.dto.DepartmentTargetDTO;
import com.chenfan.mcn.model.dto.DepartmentTargetSearchDTO;
import com.chenfan.mcn.model.vo.DepartmentTargetDetailVO;
import com.chenfan.mcn.model.vo.DepartmentTargetListVO;
import com.chenfan.mcn.model.vo.DepartmentTargetPageVO;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author lizhejin
 * @since 2021-04-20
 */
public interface DepartmentTargetService extends IService<DepartmentTarget> {

    /**
     * 新增部门目标管理
     *
     * @param departmentTargetList {@link DepartmentTargetDTO}
     * @return Integer
     */
    Integer addTarget(List<DepartmentTargetDTO> departmentTargetList);

    /**
     * 部门目标详情
     *
     * @param id
     * @return {@link DepartmentTargetDTO}
     */
    DepartmentTargetDTO targetDetail(Long id);

    /**
     * 部门目标删除
     *
     * @param id
     * @return Integer
     */
    Integer deleteTarget(Long id);

    /**
     * 部门目标编辑
     *
     * @param departmentTargetDTO {@link DepartmentTargetDTO}
     * @return Integer
     */
    Integer updateTarget(DepartmentTargetDTO departmentTargetDTO);

    /**
     * 部门目标列表
     *
     * @param dto
     * @return List<DepartmentTargetListVO> {@link DepartmentTargetListVO}
     */
    List<DepartmentTargetListVO> targetList(DepartmentTargetSearchDTO dto);

    /**
     * 季度销售额更新落库
     *
     * @return Integer
     */
    void updateQuarterSales();

    /**
     * 指定部门季度目标
     *
     * @param mcnPage
     * @param dto
     * @return
     */
    Page<DepartmentTargetPageVO> targetPage(McnPage<DepartmentTargetPageVO> mcnPage, DepartmentTargetSearchDTO dto);

    /**
     * 指定季度部门目标金额详情
     *
     * @param quarterCode
     * @return
     */
    List<DepartmentTargetDetailVO> detailByQuarter(String quarterCode);

}
